package mainDataManager;


import java.util.List;

import com.jfinal.core.Controller;

import xtgl.Privilege;

public class WlsjglController extends Controller{
	//一次要查询的默认条数
	private static int def_number = 10;

	//定义需要查询的字段
	private static String wlbm = "";//物料编码
	private static String wlmc = "";//物料名称
	private static String zlbm = "";//子料编码
	private static String zlmc = "";//子料名称
	private static String ggxh = "";//规格.型号
	//查询所有的物料数据信息
	public void index(){
		def_number = 10;
		wlbm = "";
		wlmc = "";
		zlbm = "";
		zlmc = "";
		ggxh = "";
		setAttr("list", Wlsjgl.dao.getList());
		render("/mainDataManager/wlsjgl.html");
	}

	/**
	 * 重置查询
	 */
	public void sele(){
		wlbm = getPara("wlbm");
		wlmc = getPara("wlmc");
		zlbm = getPara("zlbm");
		zlmc = getPara("zlmc");
		ggxh = getPara("ggxh");
		renderNull();
	}

	/**
	 * 更改每页显示的条数
	 */
	public void gghs(){
		def_number = getParaToInt("def_number");
		renderText("success");
	}
	public void pagedemo(){
		int number = getParaToInt("pageNumber");
	}

	/**
	 * 添加物料数据
	 */
	public void addWlsj(){
		int success;
		if(!Wlsjgl.dao.save()){
			success = -1;
		}
		success = 0;
		render("/wlsjgl", success);
	}
}
